package com.lfd.mapstruct.struct;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @项目名： spring-emq
 * @包名： com.lfd.mapstruct.struct
 * @文件名: UserService
 * @创建者: liufudong@szyh-smart.com
 * @创建时间: 2024/10/19 23:38
 * @描述：
 */
@Service
public class UserService {
    @Resource
    private UserMapper userMapper;
    public User convertToEntity(UserDTO userDTO) {
        return userMapper.toEntity(userDTO);
    }

    public UserDTO convertToDTO(User user) {
        return userMapper.toDTO(user);
    }

    public User cloneUser(User user) {
        return userMapper.clone(user);
    }
}
